<?php
/**
 * Created by PhpStorm.
 * User: 图图
 * Date: 2021-6-8
 * Time: 16:29
 */

namespace app\web\controller;

use app\common\controller\Api;
use app\common\model\Factor;
use app\common\model\Fenorder;
use think\Db;


/**
 * 前台首页控制器
 * @package app\index\controller
 */
class Opinion extends Auth
{
    public $noNeedLogin = [ ];

    public function index(){
        if($this->request->isPost()){
            $getData = $this->request->post();
            if(empty($getData['content'])){
                $this->result('缺少参数','',200);
            }
            $insertData['user_id'] = $this->userInfo['id'];
            //$insertData['phone'] = $getData['phone'];
            //$insertData['image'] = $getData['image'];
            $insertData['content'] = $getData['content'];
            $insertData['created_time'] =time();
            $insert = Db::name('qt_opinion')->insert($insertData);
            if($insert){
                $this->result('添加成功','',200);
            }
            $this->result('系统繁忙，请稍后再试！','',204);
        }
        $this->result('无效的请求','',204);
    }

}
